<%@ page language="java" contentType="text/html; charset=UTF-8" import="org.springframework.ui.ModelMap" import="java.util.*,com.device.operating.entity.*"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<link rel="stylesheet" type="text/css" href="/xasj/easyui/themes/default/easyui.css">
<link rel="stylesheet" type="text/css" href="/xasj/easyui/themes/icon.css">
<link rel="stylesheet" type="text/css" href="/xasj/easyui/themes/color.css">
<script type="text/javascript" src="/xasj/easyui/jquery.min.js"></script>
<script type="text/javascript" src="/xasj/easyui/jquery.easyui.min.js"></script>
<%
List<Dajuxiang> listdjx=(List<Dajuxiang>)request.getAttribute("listdjx");
List<Juxiang> listjx=(List<Juxiang>)request.getAttribute("listjx");
String jxId="0";
String djxId="0";
if(request.getAttribute("jxId")!=null){
	jxId=request.getAttribute("jxId").toString();
}
djxId=request.getAttribute("djxId").toString();
%>
<script type="text/javascript">
$(function(){//延迟加载
	var ndjxId=<%=djxId%>;
	$('#editdjxjx').click(function(){
		var jxId=$('#juxiang').combobox('getValue');
		var djxname=$('#dajuxiang').combobox('getText');
		var djxId=$('#dajuxiang').combobox('getValue');
		if(jxId=='0'||djxId=='0'){
			alert('未选择');
			return '0';
		}
		if(djxId==ndjxId){
			alert('未做修改');
			return '0';
		}
		$.ajax({
			type:'POST',
			url:'editdjxjx',
			data:{
				jxId:jxId,
				djxId:djxId,
				djxname:djxname
			},
			success:function(data){
				alert(data.msg);
				ndjxId=djxId;
			}
		});
	});
});
</script>
</head>
<body >
<div style="padding-left:30%">
<table>
<tr>
<td style="width:100px">
设备局向：
</td>
<td>
<select id="juxiang" class="easyui-combobox" panelHeight="auto" style="width:100px">
	<option value="0">请选择</option>
<%for(Juxiang jx:listjx){%>
	<option value="<%=jx.getJxId()%>"<%if(jxId.equals(jx.getJxId())){
		%>selected="selected"<%
	} %>><%=jx.getJxname()%></option>
<%}%>						
</select>
</td>
</tr>
<tr>
<td style="width:100px">
设备汇接：
</td>
<td>
<select id="dajuxiang" class="easyui-combobox" panelHeight="auto" style="width:100px">
	<option value="0">请选择</option>
<%for(Dajuxiang djx:listdjx){%>
	<option value="<%=djx.getDjxId()%>"<%if(djxId.equals(djx.getDjxId())){
		%>selected="selected"<%
	} %>><%=djx.getDjxname()%></option>
<%}%>						
</select>
</td>
</tr>
<tr>
<td>
</td>
<td>
<a id="editdjxjx" class="easyui-linkbutton c8" style="width:120px">提交</a>
</td>
</tr>
</table>
</div>
</body>
</html>